#include "app_mqtt.h"
#include "log.h"
#include  "unistd.h"
 

static int  recieve_callback  (char *data,int len)
{
    log_info("接收到mqtt的数据  data:%s",data);
    return 0;
}

int main(int argc, char const *argv[])
{
    //init
    int ret=app_mqtt_init();
    if(ret!=0)
    {
        log_error("app_mqtt_init error");
        return -1;
    }
    // 注册一个接收数据的处理回调
    app_mqtt_register_callback(recieve_callback);

    sleep(5);
    app_mqtt_send("hello atguigu !!!",17);
    while (1)
    {
        /* code */
    }
    app_mqtt_destroy();

    return 0;
}
